package com.team.sns.services.impl;

import java.util.List;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.sun.org.apache.xpath.internal.Expression;
import com.team.sns.entities.MsgInfo;
import com.team.sns.entities.UserMsgIndex;
import com.team.sns.persistence.impl.JPAProvider;
import com.team.sns.services.MessageService;

public class MessageServiceImpl extends JPAProvider<MsgInfo> implements MessageService{
	
	public void save(MsgInfo info){
		super.save(info);
	}
	
	public void saveMsgIndex(UserMsgIndex index){
		this.em.persist(index);
	}

	public List<Integer> getMsgIndexsByUserId(Integer userId) {
		String sql = " from UserMsgIndex where userId = "+userId+" order by createTime desc";
		List<UserMsgIndex> lst = (List<UserMsgIndex>)this.em.createQuery(sql);
		return null;
	}

}
